package com.stu.entity.base;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.GenericGenerator;

/**
 * 实体类 基本父类
 * @author lijian
 *
 */
/**
 * MappedSuperclass 注解的作用是不生成映射类，标明这是一个类的父类，该类的属性在子类生成
 *
 */
@MappedSuperclass
public class BaseEntity implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 主键
	 */
	private String uuid; 
	private Date createTime;

	public BaseEntity() {
		super();
	}
	
	public BaseEntity(String uuid) {
		super();
		this.uuid = uuid;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	@Column(name = "createTime")
	public Date getCreateTime() {
		return createTime;
	}
	@Id
	@Column(name = "uuid", nullable = false, length = 36)
	@GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
	public String getUuid() {
		return uuid;
	}

}
